<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<!-- import CSS -->
		<script src="../../js/commonCss.js"></script>
		<!-- 引入css文件 -->
		<link href="https://cdn.quilljs.com/1.0.0/quill.snow.css" rel="stylesheet">

		<title>首页管理-首页消息轮播</title>
	</head>
	<body>
		<div id="app" v-cloak>
			<div class="pd10 border-bottom ft-14 h40">
				<a href="4-indexMessage.html">
					<el-button type="text" icon="el-icon-arrow-left">返回</el-button>
				</a>
			</div>
			<div class="pd10">		
				<el-form :model="form" label-width="120px">
					<el-form-item label="标题" >
						<el-input v-model="form.name" autocomplete="off" style="width:300px;"></el-input>
					</el-form-item>
					<el-form-item label="内容" >
						<el-input type="textarea" v-model="form.content" rows="7" style="width:300px;"></el-input>
					</el-form-item>
				</el-form>
				<div class="dialog-footer text-r">
					<el-button @click="dialogFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="onSubmit">确 定</el-button>
				</div>
			</div>
		</div>
	</body>
	<!-- Include the Quill library -->
	<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
	<script src="elementui-lib/lib/vue.js"></script>
	<script src="elementui-lib/lib/index.js"></script>
	<script src="js/jquery-1.9.1.min.js"></script>
	<script src="js/axios.js"></script>
	<script src="js/data.js"></script>
	<script>
		var app = new Vue({
			el: "#app",
			mixins: [mix],
			data: function() {
				return {
					id:"",
					form: {
						name: "",
						content: ""
					},
				}
			},
			methods: {
				// 确定
				IsNull: function() {
					let flag = false;
					if (this.form.name == "") {
						this.$message.error('标题不能为空');
						return flag = true;
					}
					if (this.form.content == "") {
						this.$message.error('内容不能为空');
						return flag = true;
					}
				},
				onSubmit:function(){
					let that = this;
					if (that.IsNull()) {
						return;
					}
					console.log('===',this.form)
				},
			},
			created() {
				this.id = getQueryString("id");
				if(this.id == null){
					console.log('==添加')
				}else{
					console.log('==编辑')
				}
			},
		});
	</script>
</html>
